USE [aspnetdb]
GO

-- =============================================
-- Author     :		Anamika Mukherji
-- Create date:       
-- =============================================

create procedure sp_GetExistingDocIDM(
@par_deptID int)
as
begin

select Doc_dept.doc_id from Doc_Dept, Document, User1 where dept_id= @par_deptID and User1.role_id <> 6 and User1.role_id <>5 and Document.User1_id = User1.user1_id and Document.doc_id = doc_dept.doc_id
group by Doc_dept.doc_id
end